Skip to content

Preserve keyboard focus when Goal work is reprioritized - #8849

Merged
loopx-agent merged 1 commit into
mainfrom
codex/preserve-goal-work-disclosure-20261116
Nov 16, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/preserve-goal-work-disclosure-20261116

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

A keyboard user can focus one of the first three tasks in an owner group on the Goal Overview. If a status refresh changes its priority and moves it into “More tasks,” the row is replaced. The browser dropped focus to the page, leaving Enter with no task to open.

The owner list now takes a focus snapshot immediately before React updates the DOM. It restores the same Todo's button only when that update dropped focus. If the row moved into a closed disclosure, the existing native disclosure opens so Enter can reach the task. Focus elsewhere and ordinary browsing retain their existing behavior.

Author Declaration

Criterion Disposition Validation
V6 keyboard continuity Implemented for a focused owner-row reprioritization Status readback moves the row into the collapsed disclosure. Enter opens the original task. The same update while a lens button is focused leaves that button focused and the disclosure closed.
V3, V9 and V10 preserve task access, existing reads and render limits Preserved The M2 scenario retains all 200 tasks, classification and owner grouping, native inspection, no mutation requests, and the existing initial render, expansion and lens budgets.

Scope And Continuation

The change lives in the Goal Overview owner list. It uses the existing scoped page and task identity. The standard fixture exercises fresh status readback and an existing task drawer. The hosted 184/200 visibility failure on #8717 remains unexplained. Matched local runs of its existing assertion reached 200 on both revisions.

Validation

Tested head 82ee64e1ed5377ad490e2bec19a983930a93a5d0, based on f21b3a57abfb26fa6eafd808f0f5ac3516f84a12. Source and built Chat bundle use synthetic status and dependency data. Hosted CI and independent review are pending.

Check Result Evidence
Before/after keyboard regression Passed The final regression fails on unchanged base source with only the test added. Its refreshed row is under a closed disclosure and focus drops to the page body. On the candidate, it retained visible focus and Enter opened the same Todo. The case with focus outside the list also passed.
Existing M2 browser journey Passed Chromium 151.0.7922.34 and Node 22.22.3 on macOS and isolated Linux arm64. Both ordinary and coverage passes retained 200 tasks. Ordinary expansion was 99 → 118 ms on macOS and 118 → 119 ms on Linux in these local samples.
Built Chat entry point Passed Verified Chat bundle served by the repository's HTTP entry point. The keyboard journey passed at desktop and narrow widths with the synthetic status fixture.
Browser harness and premerge Passed 16 M2 and shard tests, TypeScript/build validation, and the targeted quick premerge gate.
Installed desktop client Pending Local source and built bundle evidence is included below.

Frontend / Visual Evidence

UI impact changed. The first viewport uses the same Goal and work controls. On a refresh that moves the focused item, the existing disclosure opens and the focus ring follows the row. Long bilingual task labels and blocked states use the existing layout and focus styling. Captures use synthetic public fixtures.

First viewport · built Chat bundle 82ee64e1ed

Goal Overview first viewport with current work by owner
Before, base source After, built desktop Chat After, built narrow Chat
Status refresh leaves the reprioritized task folded and keyboard focus absent The same blocked task is visible and focused after refreshing status The same task retains focus at narrow width

Type of Change

  • Bug fix
  • Test update

LoopX Area

  • Public docs or presentation surface (Dashboard)

Shared-authority RFC fixture impact

N/A. The change is local to keyboard focus in the existing presentation layer.

Boundary Checklist

  • Public source and synthetic fixtures only.
  • Existing numerical render qualification and current task inspection exercised.
  • RFC bilingual premerge check passed.
  • Visual evidence refers to the tested revisions.
  • DCO sign-off.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

评审 82ee64e1ed5377ad490e2bec19a983930a93a5d0,分支基点为 f21b3a57abfb26fa6eafd808f0f5ac3516f84a12,并与当前 main@8caf2da6a52d37f722703a02d79f9a70711b5bd1 检查集成。 变更对照

动机 / Motivation

用键盘查看 Goal 概览的用户,可能在刷新状态时正停在某个负责人列表的前三项任务上。 基线把受阻任务移入折叠区后,焦点落回页面,按 Enter 无法查看原任务;候选展开对应列表并把键盘焦点交还给同一项。

在 1440px 和 390px 的构建态 Chat,Tab 可见焦点随原任务移动,Enter 打开同一 Todo,Esc 返回该任务。 验收范围为构建态 Chat 的负责人列表。安装态、实时来源以及 #8717 的历史 CI 观察各沿原验收记录。

改动思路 / Approach

状态读回仍走既有的工作投影,任务升降可能令 React 把同一个 Todo 从前三项移到另一个父节点。先保留当前按键目标的标识,再等新 DOM 提交后恢复,可以把一次刷新后的操作缩回原来的 Tab、Enter。只在刷新后查焦点时,已卸载的旧按钮标识已经丢失;让所有任务永远处在同一父节点则会重做原生折叠语义。

提交前读取浏览器当前焦点能保留即时目标,提交后只在焦点退到页面时恢复同一任务。将读写留在列表内即可修复原路径。 本 PR 交付 Goal 概览按负责人列表的键盘连续性,直接复用原任务键、原生折叠区、焦点样式和任务详情。

具体改动 / Changes

OwnerWorkGroups.getSnapshotBeforeUpdate 从自身列表捕获正在聚焦的 Todo。 componentDidUpdate 在列表可见且焦点退到页面时查询同一 Todo,必要时打开原生折叠区,再聚焦新按钮。 RemainingWork 的常规展开和 task 的详情选择沿原路。 将焦点放在工作视图选择上时,刷新保留焦点和折叠状态。移除当前任务后,Enter 不会打开另一项。 负责人列表源码 回归用例

依据 docs/architecture/rfcs/goal-workspace-surface-v0.md 的 f21b3a57abfb26fa6eafd808f0f5ac3516f84a12 修订,V3 采用原分组和顺序并保留全部 200 项,V6 验证宽窄视口键盘连续性,V9 检查刷新和浏览过程零动作、额度与校验写请求,V10 沿用 200 项的折叠和视图切换预算。

对主干的风险 / Risks

主要风险是状态刷新把焦点移到其他控件,或在长列表展开时造成不可见焦点。我在基点构建包复现原焦点丢失,在候选用实际 Tab 确认两个宽度都有 2px 的焦点轮廓,并验证折叠区返回前三项、任务被移除、外部控件仍聚焦和 12 项稀疏读回。目视检查概览、展开区和窄屏任务详情,详情保留现有的读取失败提示。

200 项合成数据在三个视图都可达。15 次本地切换最大 374 ms,五组中位数均低于 300 ms,展开约 59 ms。标准预合的 4 项直接和 5 项选中检查通过,4 项任务浏览用例通过;对当前 main 的 Git 三方集成无冲突。历史 #8717 的托管失败和当前 CI 归各自证据。 原有渲染预算 相关 PR

我的整体评价 / Verdict

桌面的 Goal 目标、交付状态与当前工作层级保持清楚。窄屏目标和工作入口仍可读;展开后受阻行的红色状态和蓝色键盘轮廓同时可见。长双语任务可在原详情查看,读不到完整要求时原重试入口仍可见。 视觉验证使用 macOS Chromium 与 200 条合成状态。安装客户端、其它浏览器及 #8717 的历史托管 CI 根因仍待各自验证。

这版修复了刷新后继续用键盘检查原任务的路径,改动与现有工作投影和读回边界相称。

English verdict: APPROVE. The exact head restores visible keyboard focus and preserves the original Todo selection in the built Chat view.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

评审提交 82ee64e1ed5377ad490e2bec19a983930a93a5d0,对照基线 f21b3a57abfb26fa6eafd808f0f5ac3516f84a12。

动机 / Motivation

未发现阻断性问题。

在 Goal 概览中用键盘查看当前任务的操作者。状态刷新把刚聚焦的任务从负责人分组前三项移入折叠的其余任务时,主干焦点回落到页面。要检查原任务,用户需重新打开折叠区、定位并选中它。候选仅在本次 DOM 更新确实丢失焦点、原任务仍在当前负责人的列表视图时恢复。浏览器展开必要的既有折叠区,Enter 打开同一个 Todo 及它的详情。改动限于概览的按负责人视图。原任务状态、分组及详情读回继续用现有源。

按 docs/architecture/rfcs/goal-workspace-surface-v0.md 的 f21b3a57abfb26fa6eafd808f0f5ac3516f84a12,核对 V3 的分组可达、V6 的完整键盘路径、V9 的只读交互和 V10 的 200 项渲染预算。 RFC 验收

改动思路 / Approach

在 React 提交开始前保存原按钮的 Todo ID。提交后只在焦点落回页面时查找同一 ID。已在列表外的焦点和主动选中的视图沿当前操作保持。复用现有排序、原生 details 和 Todo 详情入口,增加一处提交前后焦点恢复。 更新完成后的 effect 已读不到被替换按钮,提交前快照可以保存这一次的身份。

具体改动 / Changes

关键代码讲解

  • OwnerWorkGroups.getSnapshotBeforeUpdate。在 DOM 切换前只记住当前 owner 列表中的焦点按钮与 Todo ID。 源码
  • OwnerWorkGroups.componentDidUpdate。更新后确认当前列表可见、原焦点确实丢失。按同一 ID 找回按钮,打开它所在的折叠区并聚焦。 源码
  • RemainingWork。保留原生折叠和选中任务自动展开路径,旁边的 Board、Map 和详情入口保持原实现。 源码
  • verifyFocusAfterReprioritization。先验证焦点在列表外,继而从原任务送入重排并用 Enter 打开同一详情。 源码

对主干的风险 / Risks

同一独立键盘用例先用 Shift+Tab 聚焦,再改变状态。行仍存在于同一负责人分组的折叠区内,activeElement 回到 BODY,Enter 不打开详情。手动展开和定位后可开原任务。1440×1000、390×844 两次对照均在刷新后自动展开且原按钮具有可见焦点环,Enter 后 URL 与详情显示同一个 Todo。焦点放在按负责人按钮时,同一刷新不展开折叠区,按钮保持焦点。 读回场景没有请求 action、quota 或 validator。

两边三种视图各保留 200 项。按相同五条转移各测三次,全部低于 1 秒,基线/候选最大值 381/363ms。所有分组展开分别约为 33/30ms。 这些是本地浏览器样本。16 项 M2 与分片用例、TypeScript 和定向预合并检查通过。 #8717 的历史 hosted 可见性问题仍待解释。 M2 验证

我的整体评价 / Verdict

批准此提交。默认视图仍把目标和当前工作放在同一阅读列。展开后蓝色焦点框标出刚移入折叠区的任务。桌面窗口与 390px 窄屏上,长标题、受阻状态和详情均可读。本地构建的 Chat bundle 由真实 Chat HTTP 入口提供,状态与任务详情使用合成数据。已安装桌面客户端和线上环境待验。 PR 首屏与前后截图

English verdict: APPROVE. Keyboard focus follows the same task after reprioritization, and both desktop and narrow builds open its original inspector with Enter.

@loopx-agent
loopx-agent merged commit 2998d5e into main Nov 16, 2026
40 of 48 checks passed
@loopx-agent
loopx-agent deleted the codex/preserve-goal-work-disclosure-20261116 branch November 16, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant